<!-- JSP to display the modify department form -->
<%@ page import="sg.edu.nus.iss.cats.controller.*,
                 sg.edu.nus.iss.cats.model.*,
                 sg.edu.nus.iss.cats.dataaccess.DAOException"%>

<%@include file="header.jsp" %>
<%@include file="departmentMenu.jsp" %>
<html>
<head>
    <title><fmt:message key="title.application"/></title>
    <link rel="STYLESHEET" type="text/css" href="<%= request.getContextPath() %>/css/style.css">
</head>




<% 
    String departmentId = request.getParameter("departmentid");
    Department department = null;
    try {

        //get department details 
        DepartmentManager departmentManager = new DepartmentManager();       
        department = departmentManager.findDepartment(departmentId);
    }catch(DAOException e){
        HTMLUtil.displayException(request,response,
            "Sorry, the system could not find the details of the department "
            + departmentId);
         return;

    }
    
%>

<jsp:useBean id="departmentBean" class="sg.edu.nus.iss.cats.javabean.DepartmentsBean"/>


<h2>Modify Department details</h2>
<form name="deptForm" method="post" action="<%= request.getContextPath() %>/admin/modifyDept">

    <table>
        <tr>
            <td valign=top>Department Id:</td>
            <td colspan="3">               
                <%= department.getDepartmentId() %> 
                <input type="hidden" name="departmentid" value="<%= department.getDepartmentId() %>"> 
            </td>
        </tr>

        <tr>
            <td valign=top>Manager-In-Charge:</td>
            <td colspan="3">
              <select name="managerincharge" size="1">
                <%= departmentBean.getUserManagerMenu(department) %>                
              </select>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td> 
            <td colspan="2" align="left"><br></br>
                <button type="submit">
                    <img src="<%= request.getContextPath() %>/img/button_submit.gif" alt="" align="middle">
                 </button>&nbsp;
                <a href="javascript:history.back();"> 
                    <img src="<%= request.getContextPath() %>/img/button_cancel.gif" alt="" align="absmiddle" border="0">
                </a> 
            </td> 
        </tr>
   </table>
</form>


<%@include file="footer.jsp" %>
